with ada.unchecked_deallocation;
generic
    type item is private;
    with procedure print (p_item : item);
package linked_list is
    type link;
    type link_a is access link;
    type link is
	record
	    data : item;
	    next : link_a := null;
	end record;
    type list is 
	record
	    head : link_a;
    END RECORD;
    type list_a is access list;

    procedure free is new ada.unchecked_deallocation (list, list_a);
    procedure free is new ada.unchecked_deallocation (link, link_a);
    
    function new_list return list_a;
    function insert_first (a_list : list_a; n_link : link_a) return link_a;
    function insert_first (a_list : list_a; data : item) return link_a;
    function Insert_After (Head_Link : Link_A; N_Link : Link_A) return link_a;
    function insert_after (head_link : link_a; data : item) return link_a;
    function delete_first (a_list : list_a) return link_a;
    function delete_after (head_link : link_a) return link_a;
    function delete_last (a_list : list_a) return link_a;
    procedure print_list (a_list : in list_a);

end linked_list;    


	    
    

